package com.fc.app.fcapp.service;


import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.util.Log;

import com.alibaba.fastjson.JSON;
import com.baidu.tvsafe.TVSafe;

import org.json.JSONObject;

import java.util.List;

import c.b.libccb.AbstractResultService;
import c.b.libccb.model.AvpScanResult;
import c.b.libccb.model.DnsResult;
import c.b.libccb.model.NedResult;
import c.b.libccb.model.SafeUrlInfo;
import c.b.libccb.model.VulnInfo;


/**
 * Created by fc on 2018/4/26.
 */

public class ResultService extends AbstractResultService {
    private final String TAG = "baiduResult";

    //	扫描APP应用接口 回调结果
    @Override
    public void onAvpScanResult(List<AvpScanResult> list) {
        Log.i(TAG, "onAvpScanResult: " + JSON.toJSONString(list));
    }

    @Override
    public void onVulnScanResult(List<VulnInfo> list) {
        Log.i(TAG, "onVulnScanResult: " + JSON.toJSONString(list));
    }

    @Override
    public void onNedScanResult(NedResult nedResult) {
        Log.i(TAG, "onNedScanResult: " + JSON.toJSONString(nedResult));
    }


    @Override
    public void onDnsFixed(boolean b) {
        Log.i(TAG, "onDnsFixed: " + b);
    }

    @Override
    public void onGetIpResult(DnsResult dnsResult) {
        Log.i(TAG, "onGetIpResult: " + JSON.toJSONString(dnsResult));
    }

    @Override
    public void onGetUrlInfoResult(SafeUrlInfo safeUrlInfo) {
        Log.i(TAG, "onGetUrlInfoResult: " + JSON.toJSONString(safeUrlInfo));
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return super.onBind(intent);
    }

    @Override



    public void onCreate() {
        super.onCreate();
        Log.i(TAG, "***********************Service回调结果*******************   ");
        Log.i(TAG, "onCreate: ResultService");


        //本地所有APP扫描
//        if ( TVSafe.scanVirus(true)){
//            Log.i(TAG, "漏洞扫描 succeed");
//        }else {
//            Log.i(TAG, "漏洞扫描 fail");
//        }

        //扫描系统漏洞
//        TVSafe.scanVuln(true);

        //ii.	单APP扫描
        //iii.	文件夹扫描
        // i.	网络扫描


    }
}
